package singleton;

import thread.ThreadUtils;

public class UnsafeLazySingleton {

    private static UnsafeLazySingleton uniqueInstance;

    private UnsafeLazySingleton() {
    }

    public static UnsafeLazySingleton getInstance() {
        if (uniqueInstance == null) {
            ThreadUtils.sleep(100); //模拟耗时操作
            uniqueInstance = new UnsafeLazySingleton();
        }
        return uniqueInstance;
    }

}
